<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <%layout("/WEB-INF/view/common/inc/admin_head.html",{title:'', styles:'bootstrap,font-awesome,animate,style,bootstrap-table,layui'}){%>
    <style type="text/css">
        body{padding-top:10px;padding-left: 10px}
        *{margin:0;padding:0;list-style-type:none;}
        a,img{border:0;}
        .demo h2{font-size:16px;color:#3366cc;height:30px;}
        .demo li{float:left;}
        .has-no{color:#3366cc;}
        .has-success{color: #1ab394;}
        .has-warning{color: #f8ac59;}
        .has-error{color: #ed5565;}
        .remark {
            width: 100%; /*自动适应父布局宽度*/
            overflow: auto;
            word-break: break-all;
        }
    </style>
    <%}%>
</head>

<body>
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins" style="margin-bottom: 0px;">
                <input type="hidden" readonly id="productMember" name="productMember" class="form-control" value="${user.userRealname}">
                <div class="ibox-content" style="padding:15px 20px 0px 20px;">
                    <form id="search-form" role="form" class="form-horizontal" autocomplete="off">
                        <div class="form-group">
                            <label class="control-label col-sm-1">渠道:</label>
                            <div class="col-sm-2">
                                <select  name="salesChannelName" id="salesChannelName" class="form-control">
                                    <option value="">请选择渠道</option>
                                    <%for(var dict in channel){%>
                                    <option value="${dict.channelName}"  >${dict.channelName}</option>
                                    <%}%>
                                </select>
                            </div>
                            <label class="control-label col-sm-1">SKU:</label>
                            <div class="col-sm-2">
                                <input type="text" name="salesSku" id="salesSku" placeholder="请填写SKU" class="form-control">
                            </div>
                            <label class="control-label col-sm-1">ASIN:</label>
                            <div class="col-sm-2">
                                <input type="text" name="salesAsin" id="salesAsin" placeholder="请填写请购单号" class="form-control">
                            </div>
                            <a class="search-btn btn btn-success" style="margin-bottom: 0px;">查询</a>
                        </div>
                    </form>
                </div>
            </div>
        <div id="toolbar" class="btn-group" style="margin-bottom:5px;">
            <button  class="add-btn layui-btn layui-btn-normal layui-btn-sm" style="margin-top: -6px;margin-left: -4px" id="import-btn"  name="import-btn">
                <i class="fa fa-plus" aria-hidden="true"></i> 导入预测销量
            </button>
            &nbsp;
            <button  class="import-stock-btn layui-btn layui-btn-danger layui-btn-sm" style="margin-top: -6px;margin-left: -4px" id="import-stock-btn"  name="import-stock-btn">
                <i class="fa fa-plus" aria-hidden="true"></i> 导入FBA库存
            </button>
            &nbsp;
            <button  class="layui-btn  layui-btn-sm" style="margin-top: -6px;margin-left: -2px">
                <i class="fa fa-download"></i>
                <a href="/excel/请购单模板.xlsx" style="color: white" download>模板下载</a>
            </button>


        </div>
        <!-- START 右侧数据 -->
        <!-- START 数据表格 -->
        <table id="relatedTable"
               data-toolbar="#toolbar"
               data-side-pagination="server"
               data-pagination="true"
               data-resizable="true"
               data-side-pagination="server"
               data-url="/sea/data/sales/stock/findByCnd"
               data-page-size="15"
               class="table table-striped table-hover"
        >
        </table>
        <!-- END 数据表格 -->

        </table>
        <!-- END 右侧数据 -->
    </div>
    </div>
</div>




<%layout("/WEB-INF/view/common/inc/admin_js.html",{modules:'jquery,bootstrap,bootstrap-table,dtvalidate,dtvalidate-lang-zh_cn,bootstrap-table-zh-CN,laydate,layer,layui,upload'}){}%>
<script>
    laydate.render({
        elem: '#salesDate',
        type: 'date',
        format: 'yyyy-MM-dd',
        trigger: 'click'
    });


    var $relatedTable = $('#relatedTable'),selections=[];
    $(function(){
        //START 表格配置
        $relatedTable.bootstrapTable({
            columns: [
                {
                    title: 'Listing',
                    field: 'stockListing',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '日期',
                    field: 'stockDate',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '期初库存',
                    field: 'stockNumber',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '当期销量',
                    field: 'salesNumber',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '当期海运入库',
                    field: 'stockPhysicalNumber',
                    align: 'center',
                    valign: 'middle'
                },
                {
                    title: '当期采购入库',
                    field: 'stockProduceNumber',
                    align: 'center',
                    valign: 'middle'
                }, {
                    field: 'operate',
                    title: '操作',
                    align: 'center',
                    valign: 'middle',
                    formatter: optFormatter
                }
            ],
            onLoadSuccess : function() {

            },
            onExpandRow: function (index, row, $detail) {
                InitSubTable(index, row, $detail);
            }
        })
        //操作菜单
        function optFormatter(value,row){
            var content = '';

            return content;
        }
    });

    $('.search-btn').on('click',function(){
        $relatedTable.bootstrapTable('refresh', { url:'${ctxPath}/sea/data/sales/findByCnd.do?'+$('#search-form').serialize() });
    });
</script>
</body>
</html>
